Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Volume geometry type #417

Merged
merged 20 commits into from
Oct 4, 2024
Merged

Volume geometry type #417

merged 20 commits into from
Oct 4, 2024

Conversation

frasercl
Copy link
Contributor

@frasercl frasercl commented Sep 28, 2024

Review time: smallish (10-20min)

Resolves #406 (and #405?): adds a volume agent and geometry type using imports from volume-viewer, with enough rendering code to show the volume's bounding box.

NOTE: per the strategy discussed in #405, this change pulls in volume-viewer as a file dependency. The code in this PR only works if volume-viewer is built from the simularium-volumes branch in a sibling directory to this repo. (Also, we may have to loosen some checks to let this and future PRs on this feature merge?)

Screenshot

you can tell it's at least loading volume metadata because the box is the right shape

image

@frasercl frasercl marked this pull request as ready for review September 30, 2024 18:02
@frasercl frasercl requested a review from a team as a code owner September 30, 2024 18:02
@frasercl frasercl requested review from interim17 and ShrimpCryptid and removed request for a team September 30, 2024 18:02
@ShrimpCryptid
Copy link
Contributor

ShrimpCryptid commented Sep 30, 2024

Looks like the unit tests/type checks are failing... Could you fix those?

edit: ah, see the comment in the description now. Will review anyways

Copy link
Contributor

@ShrimpCryptid ShrimpCryptid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a couple minor questions/comments!

src/visGeometry/VolumeModel.ts Outdated Show resolved Hide resolved
src/visGeometry/VolumeModel.ts Outdated Show resolved Hide resolved
if (this.image) {
this.image.setTranslation(new Vector3(data.x, data.y, data.z));
this.image.setRotation(new Euler(data.xrot, data.yrot, data.zrot));
const r = data.cr * 2;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does cr stand for? radius?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The r is definitely radius and the c I'm almost certain is "collision."

Copy link
Contributor

@interim17 interim17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving right along :)

Comment on lines +387 to +398
private async fetchVolume(url: string): Promise<VolumeModel> {
// TODO should this be in a worker? Are we already in a worker here?
// Should this class get a `VolumeLoaderContext` going?
const model = new VolumeModel();
this.setGeometryInRegistry(url, model, GeometryDisplayType.VOLUME);
const loader = await createVolumeLoader(url);
// TODO onChannelLoaded callback?
const volume = await loader.createVolume(new LoadSpec());
model.setImage(volume);
return model;
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this relevant, but the caching changes in review are removing the need for workers in that part of the code base, and there was discussion of workers affecting builds and publishing with NBSV.

Just a thought that we should use them if we need them, but if achieve 0 workers (automation fears??) then there may be some arguments for not adding them back in?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unless I am forgetting, doesn't PDB geometry still use a worker to calculate levels of detail?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The context here may be slightly different. In volume-viewer we moved loading to a separate worker because playing volume time series requires loading and processing quite a lot of data per frame, and it was a problem when that processing blocked rendering. We have an externally available type, called VolumeLoaderContext, for handling offloading that processing to a worker. Questions are

  1. is it as worth it to use VolumeLoaderContext here as it is in volume-viewer, given your concern and that simulation volumes may be smaller on average than microscope volumes; and
  2. if 1, who should own VolumeLoaderContext and how should it grant access to it?

To be resolved by future work.

@frasercl frasercl merged commit ccfccf3 into volume-agents Oct 4, 2024
4 of 5 checks passed
@frasercl frasercl deleted the feature/volume-geometry branch October 4, 2024 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants